using System;
using System.Data;
using System.Data.Sql;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using BLL.Classes;
namespace BLL
{
    public class CategoryManager
    {
        public static string GetAllCategoriesForMenu(string cultureName)
        {
            using (DataSet  ds = BLL.BLLManager.ExecGetDSAllSP("Category",new object[]{cultureName}))
            {
                ds.DataSetName = "Menus";
                ds.Tables[0].TableName = "Menu";
                DataRelation relation = new DataRelation("ParentChild", ds.Tables["Menu"].Columns["categoryID"], ds.Tables["Menu"].Columns["parentID"], false);
                relation.Nested = true;
                ds.Relations.Add(relation);
                return ds.GetXml();
            }
        }
        public static int AddCategory(int parentId,string text,string desc)
        {
            return BLL.BLLManager.ExceInsertToSP("Category", new object[] {parentId,text,desc });
        }
    }
}